<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2018-03-02 17:14:35 apple $
 第三方购买插件类
*/
namespace core;
defined('BY_JYA') or exit('error');
class open_app{
	public function update($workeropen_pid){
		$app=pdo_get('core_open_plugin',array('id'=>$workeropen_pid));
		if(!$app['pid']){
			exi('该企业微信应用没用绑定插件！','error');
		}
		$isadd=pdo_getcolumn('core_account_permissions',array('pid'=>$app['pid'],'uniacid'=>$_SESSION['uniacid']),'id');
		if($isadd){
		}else{
			$data=array(
				'uniacid'=>$_SESSION['uniacid'],
				'pid'=>$app['pid'],
				'type'=>$app['tabletype'],
				'time'=>TIMESTAMP+$app['days']*86400
			);
			pdo_insert('core_account_permissions',$data);
		}
		return true;
	
	}
}